package com.sqllog.admin.auth.mapper;

import com.sqllog.admin.auth.domain.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户
 *
 * @author chennengcheng
 * @date 2022-01-14 14:34
 * @remark
 */

public interface UserMapper {


    /**
     * Describe: 根据 username 查询用户
     * Param: username
     * Return: User
     */
    User selectByUsername(@Param("username") String username);

    /**
     * Describe: 根据 Id 查询用户
     * Param: id
     * Return: User
     */
    User selectById(@Param("id") String id);

    /**
     * Describe: 根据 User 条件查询用户
     * Param: username
     * Return: User
     */
    List<User> selectList(User param);

    /**
     * Describe: 根据 User 条件查询用户数量
     * Param: username
     * Return: Integer
     */
    Integer count(User User);

    /**
     * Describe: 添加用户数据
     * Param: username
     * Return: Integer
     */
    Integer insert(User User);

    /**
     * Describe: 根据 Id 修改用户
     * Param: username
     * Return: Integer
     */
    Integer updateById(User User);

    /**
     * Describe: 根据 Id 删除用户
     * Param: username
     * Return: Integer
     */
    Integer deleteById(String id);


    /**
     * Describe: 根据 Id 批量删除
     * Param: username
     * Return: Integer
     */
    Integer deleteByIds(String[] ids);

    /**
     * Describe: 重置部门
     * Param: deptId
     * Return: Integer
     */
    Integer resetDeptByDeptId(String deptId);

    /**
     * Describe: 批量重置部门
     * Param: deptIds
     * Return: Integer
     */
    Integer resetDeptByDeptIds(String[] deptIds);
}
